<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .father{
            width: 200px;
            height: 200px;
            background-color: greenyellow;

        }
        .son{
            width: 100px;
            height: 100px;
            background-color: blue;
           margin: 0 auto;
        }
    </style>
</head>
<body>
<div class="father">
    <!--
    要用大容器的padding
    不要用小容器的margin
    -->
    <div class="son">

    </div>
</div>
</body>
</html>